<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    /* 
        量词
            {m} 正好m个
            {m,} 至少m个
            {m,n} m-n 个
            + 一个以上  相当于{1,}
            *   零个或多个 相当于{0,}
            ?   0个或1个 相当于{0,1}
    */

    console.log(/a{3}/.test("aaaa")); // true
    console.log(/^a{3}$/.test("aaaa")); // false
    console.log(/ab{3}/.test("abababab")); //false  {3}只对最近的b生效
    console.log(/(ab){3}/.test("abababab")); //true
    console.log(/(abc)+/.test("abc")); //true
    console.log(/(abc)*/.test("")); //true
    console.log(/hello?/.test("hell")); //true
    console.log(/hello1?/.test("hello")); //true
    console.log(/[a-z]/.test("A")); //false
    console.log(/[a-z]/i.test("A")); //true
  </script>
</html>
